package com.ccrfid.rmc6.repository.business.patrol;

import com.ccrfid.rmc6.entity.business.patrol.PatrolScheduleEntity;
import org.springframework.data.repository.Repository;

import java.sql.Date;
import java.util.List;

public interface PatrolScheduleRepository extends Repository<PatrolScheduleEntity, Long> {
    //
    PatrolScheduleEntity getById(Long id);
    //
    PatrolScheduleEntity getByDutyDateAndTimeRangeId(Date dutyDate, Long timeRangeId);
    //
    List<PatrolScheduleEntity> getAllByDutyDateBetween(Date startDate, Date stopDate);
    //
    List<PatrolScheduleEntity> getAllByPatrolStatusAndDutyDateLessThan(Integer patrolStatus, Date dutyDate);
    //
    PatrolScheduleEntity save(PatrolScheduleEntity entity);
    //
    void deleteById(Long id);
    //
    void delete(PatrolScheduleEntity entity);
    //
    void deleteAllByGroupId(Long groupId);
    void deleteAllByTimeRangeId(Long timeRangeId);
    //
    boolean existsById(Long id);
    //
    boolean existsByDutyDateAndTimeRangeId(Date dutyDate, Long timeRangeId);
}
